package cn.woochen.mvvmframe.config.status

import cn.woochen.comlib.util.PackageUtil
import cn.woochen.comlib.util.ext.showToast

object ErrorCodeHandleHelper {

    fun exceptionCodeHandle(e: CustomException) {
        if ((e.code == ErrorCode.TOKEN_INVALIDE)) {
            PackageUtil.currentActivity?.apply {
                showToast(e.msg)
            }
        } else {
            if (!ErrorCode.noToastCodes.contains(e.code)) {
                PackageUtil.currentActivity?.apply {
                    showToast(e.msg)
                }
            }
        }
    }
}